package main

import (
	"fmt"
	"log"
	"server/config"
	"server/core"
)

func main() {

	//配置文件初始化
	err := config.InitConfigFromFile("config.yaml")
	if err != nil {
		fmt.Println("init config file error", err)
	}

	s, err := core.NewApiServer()
	if err != nil {
		log.Fatal(err)
	}

	err = s.PrepareRun()
	if err != nil {
		log.Fatal(err)
	}

	err = s.Run()
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("i am main func")
}
